using System.Threading;
using System.Windows.Forms;

namespace TimerUppercut.Utils
{
    /// <summary>
    /// Handles any thread exceptions
    /// </summary>
    public class ThreadExceptionHandler
    {
        /// <summary>
        /// Handles the exceptions not caught by the application's handlers.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Threading.ThreadExceptionEventArgs"/> instance containing the event data.</param>
        public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e)
        {
            MessageBox.Show(e.Exception.Message, "Error dialog", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}